<?php
class UploadAction extends Action{

	
	public  function index(){
		$this->display("test");
	}
	
	/**
	 * 图片上传方法
	 * 
	 */
	public function picture(){
		
		//   返回的基础json 	
    	$resArray = array(
    		"isSuccess" =>"",//成功为Y，失败为N
    		"data"=>"",
    	);
    	
		
		import("ORG.Net.UploadFile");
		$upload = new UploadFile();
		$upload->maxSize = 3145728; //允许上传单个文件的大小
		$upload->allowExts = array('jpg','gif','pgn','jpeg'); //允许上传图片的拓展名
		$upload->savePath = './Public/Uploads/'; //图片的保存路径
		
		if(!$upload->upload()){
			$resArray['isSuccess'] = "N";
//			$resArray["data"] = $upload->getErrorMsg();
		}else {
			$resArray['isSuccess'] = "Y";
		}
		echo json_encode($resArray);
	}
}